.. This file was automatically converted from MediaWiki syntax. If some markup is wrong, looks weird or doesn't make sense, feel free to fix it. Please remove this comment once this file was manually checked and no "strange ReST" artifacts remain. .. _the-global-clock: The Global Clock ================ The global clock is an instance of the `ClockObject `__ class. .. only:: python It gets imported into the global namespace when you load the DirectStart/Showbase modules. .. only:: cxx There's a single instance of it already initialized that you can access statically. To get the time (in seconds) since the last frame was drawn: .. only:: python .. code-block:: python dt = globalClock.getDt() .. only:: cxx .. code-block:: cpp double dt = ClockObject::get_global_clock()->get_dt(); Another useful function is the frame time (in seconds, since the program started): .. only:: python .. code-block:: python frameTime = globalClock.getFrameTime() .. only:: cxx .. code-block:: cpp double frame_time = ClockObject::get_global_clock()->get_frame_time(); Incomplete Section ================== Note: this section is incomplete. It will be updated soon.